package com.scujj.cs6.model.vo;

import com.scujj.cs6.model.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@Schema(description = "用户简单信息")
@AllArgsConstructor
@NoArgsConstructor
public class UserSimpleVo {
    @Schema(description = "用户ID", example = "1")
    private Long id;

    @Schema(description = "用户名", example = "cirno")
    private String username;

    @Schema(description = "头像", example = "https://example.com/avatar.jpg")
    private String avatar;

    public UserSimpleVo(User user) {
        BeanUtils.copyProperties(user, this);
    }
}
